package com.zjj.day0504.hashset;

import java.util.Arrays;
import java.util.HashSet;
import java.util.Set;

/**
 * @author zhoujunjie
 * @desc TODO
 * @date 2025/5/4
 */
public class Test {
    public static void main(String[] args) {
        Person[] person = {
                new Person("zs", 20),
                new Person("ls", 18),
                new Person("zs", 20)};
        Set<Person> set = new HashSet<Person>(Arrays.asList(person));
        Person[] result = set.toArray(new Person[0]);

        for (Person p : result) {
            System.out.println(p);
        }
    }
}
